周一刚上班,会议室就传来了经理老梁的咆哮。
![e721aec79b3be26b9ba87977b34d2bf6.png](https://img.php1.cn/3cd4a/1eebe/cd5/60405fda58cd0acd.webp)
张大胖和何小痩赶紧分析原因
![9efad8104239343642d9414a14f27d0b.png](https://img.php1.cn/3cd4a/1eebe/cd5/a1be7872e8d4934f.webp)
![716c6e4b529a99f84c63040d9bb00f01.png](https://img.php1.cn/3cd4a/1eebe/cd5/bcafc120671304eb.webp)
许久都没人敢发言。
老梁打开了电脑,决定给程序员上一课。
![2262a83db3efeba9bbbbdad8d85074d2.png](https://img.php1.cn/3cd4a/1eebe/cd5/a5d7215df572c386.webp)
![7a17c553a143fa18f969f5c2585003b8.png](https://img.php1.cn/3cd4a/1eebe/cd5/0a0ce631ec450943.webp)
![3ab1b545bd594672c89ce1994fe8c840.png](https://img.php1.cn/3cd4a/1eebe/cd5/ea91d84a82557da5.webp)
新版本的开发又开始了。
![60426dcc2feccd6a89def8f76d87f947.png](https://img.php1.cn/3cd4a/1eebe/cd5/ea91d84a82557da5.webp)
![c35751e713b361a57c5016b86106dc44.png](https://img.php1.cn/3cd4a/1eebe/cd5/d34245582687a4e6.webp)
![5ef9408f1ba245f97cb89be4a2cedbe4.png](https://img.php1.cn/3cd4a/18ace/696/1d8e759bd3e6bbec.jpeg)
张大胖无奈,只好加班写单元测试用例
![3969594d754ab9e66d286a6728860057.png](https://img.php1.cn/3cd4a/1eebe/cd5/5b97d3b808d031e2.webp)
过了两天,老梁又来找张大胖了
![486cf24d176edeb71efdb76e6e1206e1.png](https://img.php1.cn/3cd4a/1eebe/cd5/4283cd4bbba41b87.png)
既然如此,张大胖也没有心情再认真地写测试了。
![5c3ed8d5aa11d865912cc7fcc2e475ae.png](https://img.php1.cn/3cd4a/1eebe/cd5/3e641eb5f5c8cd90.webp)
![cad02fce6da2625439cc9f5ba994cf44.png](https://img.php1.cn/3cd4a/1eebe/cd5/086aec93f5e1e9b2.webp)
![4d755c56141c427023ecb00a0830e177.png](https://img.php1.cn/3cd4a/1eebe/cd5/ff61bfdd3c0af92e.webp)
无可奈何的何小痩,也开始应付起来
![21363025fee636cb8dc3b1d7ba149677.png](https://img.php1.cn/3cd4a/18ace/696/1d8e759bd3e6bbec.jpeg)
大家热火朝天地写单元测试,只有小崔是例外。
![23f0337ef70fcfcb23a9b9bec70c9a40.png](https://img.php1.cn/3cd4a/1eebe/cd5/7cccb7e4b6cb5cb8.webp)
![37057d513c7998318d902fd48c19aeba.png](https://img.php1.cn/3cd4a/1eebe/cd5/1e3db12dd78db092.webp)
![145edd1cdac949c232c3846a63ab11c0.png](https://img.php1.cn/3cd4a/1eebe/cd5/70be2ca197098d98.webp)
小崔很快就学会了张大胖的做法......
![a88ea7271ac674f4d0aeb904e8c2b893.png](https://img.php1.cn/3cd4a/189d8/978/7dbdf0f38ad53545.jpeg)
有一天,何小痩的代码居然让张大胖的单元测试失败了。
![ba9e53e25b19153b4b604aec8461dd70.png](https://img.php1.cn/3cd4a/1eebe/cd5/7494af3c1cda418d.webp)
![d135970e232c116ae86615947814a214.png](https://img.php1.cn/3cd4a/1eebe/cd5/ed19db63ee478b98.png)
![9a91628be7e5a35edcb9be48b27cf139.png](https://img.php1.cn/3cd4a/1eebe/cd5/d942b7ec373849c3.webp)
![53a10c88a377453e44a32d92bab1d272.png](https://img.php1.cn/3cd4a/1eebe/cd5/1e3db12dd78db092.webp)
在大家的努力下,经理终于看到了漂亮的报表。
![ca3f9da200b30d27788ded5611dd6474.png](https://img.php1.cn/3cd4a/1eebe/cd5/eec57030b649a106.webp)
新版本上线了,没想到Bug数比上个版本只多不少,老梁傻眼了。
![9c4518a006150b72c1cec51ebab553ac.png](https://img.php1.cn/3cd4a/1eebe/cd5/011ac27956d007f0.webp)
![c3d79a449249fda806f21c40462808ca.png](https://img.php1.cn/3cd4a/1eebe/cd5/d942b7ec373849c3.webp)
单元测试是好东西吗?当然是!
但是在实施单元测试的时候,真正地重视起来,循序渐进地执行了吗?
有没有给程序员留足时间?
人员的培训是否到位?观念是不是统一了?
能不能不赶进度?
需求能不能稳定下来?
对于那些难以写测试的地方,有没有总结出最佳实践?
......
在把这些问题解决之前,就开始大干快上,采用运动式的方式做单元测试,注定是要失败的。
![3ebf76642f14585918998de0fd2e21a1.png](https://img.php1.cn/3cd4a/1eebe/cd5/8ad8f3bf8da691df.webp)
![98a612f02d1acc2fe855bb2ce60a8b4f.png](https://img.php1.cn/3cd4a/1eebe/cd5/e62700fe09f8933e.webp)
![fa2169751d9c4dd68b6a46848ec1d419.png](https://img.php1.cn/3cd4a/18ace/696/1d8e759bd3e6bbec.jpeg)
![6c0a03ad8e48dd3bfeaf6584ea9028e3.png](https://img.php1.cn/3cd4a/1eebe/cd5/2fdc212433a29829.png)
点击下方图片,查看更多精彩
![f94a9676b99f0459b4a5a7af2c415e2e.png](https://img.php1.cn/3cd4a/1eebe/cd5/443b30bb45e66690.webp)
![39e83bf8e7c958672dd53f2e4978d464.png](https://img.php1.cn/3cd4a/1eebe/cd5/c72d78d7317a9e8e.webp)
![bd46e310ed43c059f4eca7a06e99dd92.png](https://img.php1.cn/3cd4a/1eebe/cd5/7494af3c1cda418d.webp)
![2fb7b412074adcf91773ff0970939ad6.png](https://img.php1.cn/3cd4a/1eebe/cd5/8170a21e8dddfd22.webp)
![35f8e5ded710ea73dc8be38148045461.png](https://img.php1.cn/3cd4a/1eebe/cd5/e62700fe09f8933e.webp)